// 受控组件
import { useState } from "react";
export default function Control(){
    const [value,setValue] = useState('')
   const handleChange = (e:any)=>{
        console.log(e.target.value)
        setValue(e.target.value)
    }
    return(
        <>
        <input type="text" value={value} onChange={handleChange}  />
        <h1>输入的值：{value}</h1>
        </>
    )
}